home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- setCsrs()
- end
-
- on stepMovie
- if not rollOver(24) then
- exit
- end if
- puppetSprite(24, 1)
- set the castNum of sprite 24 to the number of cast "Redhand"
- updateStage()
- set exitFlag to 0
- repeat while rollOver(24)
- if the mouseDown then
- if soundBusy(1) then
- sound fadeOut 1, 2 * 60
- end if
- set exitFlag to 1
- exit repeat
- end if
- end repeat
- if exitFlag then
- go("QuitReturnPlusOne", "Shiva.dir")
- else
- set the castNum of sprite 24 to the number of cast "Whitehand"
- puppetSprite(24, 0)
- end if
- end
-
- on init
- global gameCount, csr131
- repeat with chan = 2 to 7
- puppetSprite(chan, 1, )
- end repeat
- repeat with chan = 9 to 16
- puppetSprite(chan, 1, )
- set the cursor of sprite chan to csr131
- end repeat
- set the cursor of sprite 8 to csr131
- repeat with i = 1 to 24
- put "N" into line i of field "Done List"
- end repeat
- set gameCount to 0
- puppetSprite(17, 1)
- puppetSprite(18, 1)
- put " " into field "Rural Text"
- put " " into field "Urban Text"
- end
-
- on showCard
- global uCard, rCard, uCardi, rCardi, matchedCount, whichCard
- puppetSound("Bubble Gum Pop")
- set whichSprite to the clickOn
- set whichCard to the clickOn - 8
- if item 1 of line whichCard of field "Card Table" = "Y" then
- beep()
- exit
- else
- if whichCard < 5 then
- turnCardBack("R")
- else
- turnCardBack("U")
- end if
- end if
- set whichCast to "CARD" & item 2 of line whichCard of field "Card Table"
- set the castNum of sprite whichSprite to the number of cast whichCast
- if whichCard < 5 then
- set rCard to whichCast
- set rCardi to whichCard
- else
- set uCard to whichCast
- set uCardi to whichCard
- end if
- setUpText()
- updateStage()
- if uCard = rCard then
- puppetSound("Indian Bell Very Soft")
- put "Y" into item 1 of line uCardi of field "Card Table"
- put "Y" into item 1 of line rCardi of field "Card Table"
- set the castNum of sprite 8 to the number of cast "Match-on"
- set matchedCount to matchedCount + 1
- set rCard to EMPTY
- set uCard to EMPTY
- go("Match")
- else
- if whichCard < 5 then
- turnCardBack("U")
- else
- turnCardBack("R")
- end if
- set the castNum of sprite 8 to the number of cast "Match-off"
- go(the frame + 1)
- end if
- end
-
- on turnCardBack RorU
- global rCard, rCardi, uCard, uCardi
- if RorU = "R" then
- if rCard <> EMPTY then
- set rCard to EMPTY
- set the castNum of sprite (rCardi + 8) to the number of cast "Card Back"
- set the castNum of sprite 17 to the number of cast "Blank"
- else
- nothing()
- end if
- else
- if uCard <> EMPTY then
- set uCard to EMPTY
- set the castNum of sprite (uCardi + 8) to the number of cast "Card Back"
- set the castNum of sprite 18 to the number of cast "Blank"
- else
- nothing()
- end if
- end if
- updateStage()
- end
-
- on setUpText
- global uCardi, rCardi, whichCard
- if whichCard < 5 then
- set the castNum of sprite 17 to the number of cast ("R" & item 2 of line rCardi of field "card Table")
- else
- set the castNum of sprite 18 to the number of cast ("U" & item 2 of line uCardi of field "card Table")
- end if
- setTextLoc()
- end
-
- on setTextLoc
- global whichCard
- set x to line whichCard of field "Text Locations"
- set i to value(item 1 of x)
- set j to ((random(i) - 1) * 2) + 2
- if whichCard < 5 then
- set the locH of sprite 17 to 20 + value(item j of x)
- set the locV of sprite 17 to 70 + value(item j + 1 of x)
- else
- set the locH of sprite 18 to 290 + value(item j of x)
- set the locV of sprite 18 to 70 + value(item j + 1 of x)
- end if
- end
-
- on showGames
- global gameCount
- repeat with i = 9 to 16
- set the ink of sprite i to 8
- end repeat
- updateStage()
- set gameCount to gameCount + 1
- set i to gameCount + 1
- set the castNum of sprite i to the number of cast "Blank"
- updateStage()
- end
-
- on reverseCards
- set i to 0
- repeat while i < 8
- set j to random(8) + 8
- if the castNum of sprite j <> the number of cast "Card Back" then
- set the castNum of sprite j to the number of cast "Card Back"
- set the ink of sprite j to 8
- set i to i + 1
- puppetSound("Bones")
- updateStage()
- end if
- end repeat
- end
-
- on initGame
- global matchedCount, rCard, uCard
- repeat with i = 1 to 8
- put " " into line i of field "Card Table"
- end repeat
- repeat with i = 1 to 4
- set n to getCardNo()
- placeCard("U", n)
- placeCard("R", n)
- end repeat
- set rCard to EMPTY
- set uCard to EMPTY
- set matchedCount to 0
- end
-
- on getCardNo
- set found to 0
- set i to random(24)
- repeat while not found
- if line i of field "Done LIst" = "N" then
- set found to 1
- next repeat
- end if
- if i = 24 then
- set i to 1
- next repeat
- end if
- set i to i + 1
- end repeat
- put "Y" into line i of field "Done List"
- return i
- end
-
- on placeCard side, cardNo
- set done to 0
- if side = "R" then
- set j to 0
- else
- set j to 4
- end if
- repeat while not done
- set i to random(4) + j
- if item 1 of line i of field "Card Table" = " " then
- put "N," & string(cardNo) & "," into line i of field "Card Table"
- set done to 1
- next repeat
- end if
- nothing()
- end repeat
- end
-